home *** CD-ROM | disk | FTP | other *** search
/ Pesquisa Dirigida / Pesquisa Dirigida.iso / JOGOS / landerX.swf / scripts / frame_1 / DoAction.as < prev   
Text File  |  2005-01-07  |  1KB  |  63 lines

  1. function breifingDelay(screenPause, whichBrief)
  2. {
  3.    var cancel = false;
  4.    var skipWatch = whichBrief._currentframe;
  5.    briefingPause = setInterval(function()
  6.    {
  7.       if(skipWatch != whichBrief._currentframe)
  8.       {
  9.          clearInterval(briefingPause);
  10.          cancel = true;
  11.          briefingTimer = false;
  12.       }
  13.       if(!cancel)
  14.       {
  15.          if(briefingTimer)
  16.          {
  17.             if((getTimer() - briefingTimer) / 1000 >= screenPause)
  18.             {
  19.                briefingTimer = false;
  20.                clearInterval(briefingPause);
  21.                whichBrief.play();
  22.             }
  23.          }
  24.          else
  25.          {
  26.             briefingTimer = getTimer();
  27.          }
  28.       }
  29.    }
  30.    ,250);
  31. }
  32. function GetUrlParam(strUrl, strParam)
  33. {
  34.    var strUrlLC = strUrl.toLowerCase();
  35.    var nPos = strUrlLC.indexOf(strParam);
  36.    var nParamLen = strParam.length;
  37.    if(nPos > 0)
  38.    {
  39.       var nNumChars;
  40.       var nPosEnd = strUrlLC.indexOf("&",nPos + nParamLen);
  41.       if(nPosEnd > 0)
  42.       {
  43.          nNumChars = nPosEnd - nPos;
  44.       }
  45.       else
  46.       {
  47.          nNumChars = strUrl.length - nPos;
  48.       }
  49.       return strUrl.substr(nPos + nParamLen,nNumChars);
  50.    }
  51.    return "";
  52. }
  53. function GetBaseUrl(strUrl)
  54. {
  55.    var nNumChars = strUrl.length;
  56.    var nPos = strUrl.indexOf("?",0);
  57.    if(nPos > 0)
  58.    {
  59.       nNumChars = nPos;
  60.    }
  61.    return strUrl.substr(0,nNumChars);
  62. }
  63.